/*=====================================================
Critical Links
Auto Configuration Server

Authors:
	Rui Eduardo Gouveia Gil - r-gil@critical-links.com

Date: 2010
Version 0.1
=======================================================*/
#ifndef __SCONFIGURATIONS_H__
#define __SCONFIGURATIONS_H__

#include <string>
#include <vector>
#include <sstream>
#include <iostream>
#include <boost/filesystem.hpp>
#include <boost/algorithm/string.hpp>
#include <rgcpp/tools/StringTokenizer.h>

namespace acs
{

#define SC_ACTION_NEW "new"
#define SC_ACTION_SHOW "show"
#define SC_ACTION_EDIT "edit"

class SConfigurations
{
	public:
		static std::vector<std::string> getHtml(std::string divID, std::string query);
		static std::vector<std::string> createConfiguration(std::string name, std::string description);
		static std::vector<std::string> saveConfiguration(int configurationID, std::string name, std::string description);
		static std::vector<std::string> removeConfiguration(int configurationID);

		static std::vector<std::string> clearConfigurationBackupRestoreFile(std::string divID, int configurationID);

		static std::vector<std::string> addConfigurationCommand(std::string divID, int id, std::string command);
		static std::vector<std::string> switchConfigurationCommand(std::string divID, int id, int index1, int index2);
		static std::vector<std::string> removeConfigurationCommand(std::string divID, int id, int index);

	private:
		static std::vector<std::string> getConfigurationListHtml(std::string divID, std::string text);
		static std::vector<std::string> getNewConfigurationHtml(std::string divID);
		static std::vector<std::string> getEditConfigurationHtml(std::string divID, int configurationID);
		static std::vector<std::string> getConfigurationHtml(std::string divID, int configurationID);

		static std::string getConfigurationCommandHtml(int configurationID);
};

}

#endif

